<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org"><!-- 引入命名空间 -->
<head>
    <title>山朴奈竞赛 - 加入队伍</title>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}"></link>
    <link rel="stylesheet" th:href="@{/css/common.css}">
    <style>
        table {
            border-collapse: collapse;
            width: 100%;
        }

        th,
        td {
            border: 1px solid #dddddd;
            text-align: left;
            padding: 8px;
        }

        th {
            background-color: #f2f2f2;
        }
		a {
		    color: rgb(128, 128, 128);
		    text-decoration: none;
		    margin-left: 15px;
		    transition: color 0.3s ease;
		}

		a:hover {
		    color: rgb(0, 0, 64);
		}

    </style>
</head>

<body>
    <div class="nav">
        <h5>山朴奈</h5>
		<div class="spacer"></div>
		<a th:href="@{/}">首页</a>
		<a th:href="@{/user/oneself}">修改信息</a>
		<a th:href="@{/contest/view}">竞赛项目列表</a>
		<a th:href="@{/team/list}">竞赛队伍列表</a>
		<a th:href="@{/picture/list}">上传获奖证书</a>
		<a th:unless="${user!= null}" th:href="@{/application/listStudent}">我的竞赛</a>
		<a th:href="@{/login}">登录管理</a>

		</div>
    <h1>加入队伍</h1>
    <table>
        <thead>
            <tr>
                <th>队伍名称</th>
                <th>队伍描述</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <!-- 假设这里从后端获取队伍列表并使用Thymeleaf遍历 -->
            <tr th:each="team : ${teams}">
                <td th:text="${team.teamname}"></td>
                <td th:text="${team.content}"></td>
                <td>
                    <a th:unless="${session.user.id==5}" th:href="@{/team/jointeam2(teamId=${team.id})}" role="button" onclick="return confirm('确定要加入这个队伍吗？')">加入</a>
                </td>
            </tr>
        </tbody>
    </table>
</body>

</html>